package com.example.application.bean;

import org.springframework.stereotype.Component;

import java.io.Serializable;
import java.util.List;

/**
 * 分页实体
 * @param <T>  被分页对象类型
 */
@Component
public class PageBean<T> implements Serializable {

    //当前页数
    private int currentPage;

    //每页条数
    private int pageSize;

    //总条数
    private int tolNum;

    //总页数
    private int tolPage;

    private List<T> datas;

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getTolNum() {
        return tolNum;
    }

    public void setTolNum(int tolNum) {
        this.tolNum = tolNum;
    }

    public int getTolPage() {
        return tolPage;
    }

    public void setTolPage(int tolPage) {
        this.tolPage = tolPage;
    }

    public List<T> getDatas() {
        return datas;
    }

    public void setDatas(List<T> datas) {
        this.datas = datas;
    }

    @Override
    public String toString() {
        return "PageBean{" +
                "currentPage=" + currentPage +
                ", pageSize=" + pageSize +
                ", tolNum=" + tolNum +
                ", tolPage=" + tolPage +
                ", datas=" + datas +
                '}';
    }
}
